package finalproject.model.items;

import java.util.List;

import finalproject.model.player.Player;
import finalproject.model.player.PlayerModel;
import finalproject.view.StringManager;

/**
 * A scouter is a special item that is used to reveal the details of all the player 
 * in the game (name, energy, pet, pet abilities, pet energy, items) * 
 * 
 * @author Shafiq Daniel
 *
 */

public class Scouter extends Item{


	public Scouter() {
		super(StringManager.getString("scouter"), StringManager.getString("scouterdescription"), 1, true, false, false);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void use(Player player) {
		// TODO Auto-generated method stub
			getAllPlayerInfo();
		
	}

	/**
	 * Display the info for all player
	 */
	private void getAllPlayerInfo() {
		// TODO Auto-generated method stub
		String info = "";
		List<Player> listPlayer = PlayerModel.getInstance().getPlayers();
		
		for(int i=0;i<listPlayer.size();i++)
		{
			info = info + "PLAYER " + (i+1) + "\n" + listPlayer.get(i) + "\n" + "Pet:\n" + listPlayer.get(i).getPet()
					+ "Item:\n" + listPlayer.get(i).listItem() + "\n";
		}
		
		StringManager.outPutText(info);
	}
	

}
